/*
 * @Author: huangjinyao huangjinyao@hjy.cn
 * @Date: 2024-07-04 17:52:41
 * @LastEditors: 朝言夕识 11442050+we-know-each-other-every-day@user.noreply.gitee.com
 * @LastEditTime: 2024-07-06 15:19:15
 * @FilePath: \小兔仙项目\vue-rabbit\src\apis\cart.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import httpInstance from '@/utils/http'

//加入购物车
export const insertCartAPI=({skuId,count})=>{
    return httpInstance({
        url:'/member/cart',
        method:'post',
        data:{
            skuId,
            count
        }
    })
}

//获取购物车列表
export const findNewCartListAPI=()=>{
    return httpInstance({
        url:'/member/cart',
        method:'get'
    })
}

//删除购物车
export const delCartAPI = (ids) => {
    return httpInstance({
      url: '/member/cart',
      method: 'DELETE',
      data: {
        ids
      }
    })
  }


  //合并购物车
  export const mergeCartAPI = (data) => {
        return httpInstance({
        url: '/member/cart/merge',
        method: 'post',
        data
      })
  }